package co.yixiang.modules.shop.entity;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import co.yixiang.common.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author frq
 * @date 2020-06-09
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "YxInvestIncome", description = "投资管理表")
public class YxInvestIncome extends BaseEntity {

    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "商品ID")
    private Integer productId;
    @ApiModelProperty(value = "订单ID")
    private Integer orderId;
    @ApiModelProperty(value = "投资价格")
    private Integer investPrice;
    @ApiModelProperty(value = "类型 0：机器人  1：实际投资")
    private Integer type;
    @ApiModelProperty(value = "商品名称")
    private String productName;
    @ApiModelProperty(value = "商品图片")
    private String image;
    @ApiModelProperty(value = "投资者姓名")
    private String investName;
    @ApiModelProperty(value = "收益日期")
    private Date incomeDate;
    @ApiModelProperty(value = "创建日期")
    private Date addTime;
    @ApiModelProperty(value = "累计收益")
    private BigDecimal incomeTotal;
    @ApiModelProperty(value = "昨天收益")
    private BigDecimal incomeLastday;

    public void copy(YxInvestIncome source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }
}